<div id="header">
	<div class="logo">
		<a href="http://resources.scratchr.org/"></a>
	</div>
	<ul id="nav">
		<li><a href="http://resources.scratchr.org/index">home</a></li>
		<li><a href="/resources">resources</a></li>
		<li><a href="/share">share</a></li>
		<li><a href="/learn">learn</a></li>
		<li><a href="/about">about</a></li>
	</ul>
	
	<div id="userbar">
	<?php
	if ($resdap_user_rank != 'guest') {
		//Basic account features
		echo "Welcome, <a href=\"http://scratch.mit.edu/users/$resdap_user_name\">$resdap_user_name</a> | "
			.'<a href="/logout">Logout</a>'.
			 " ($resdap_user_rank)";
		//end basic account stuff
		if ($resdap_mod_features) {
			//echo '<a href="/logout">somemodfeature</a> | ';
		}
		if ($resdap_admin_features) {
			//echo '<a href="/adminphpinfo">PHP info</a> | ';
		}
	} else {
		echo '<a href="#" onclick="showLogin()"; return false;">Login</a> or <a href="http://scratch.mit.edu/signup" target="_blank">Signup</a> for an account';
	}
	?>
	</div>
	
	<div id="searchbar">
		<form action="/search " id="cse-search-box">
	  	<div>
	    	<input type="hidden" name="cx" value="005211699805409077090:seeqj_yqj_c" />
	    	<input type="hidden" name="cof" value="FORID:11" />
	    	<input type="hidden" name="ie" value="UTF-8" />
	    	<input type="text" name="q" id="cse_q"/>
	    	<input type="submit" name="sa" value="Search" />
	  	</div>
		</form>
	</div>
	<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
	<?php write_message_banner(); ?>
</div>

<?php if ($resdap_user_rank == 'guest') { ?>
	<div id="login" class="bar_fullwidth">
		<form action="/login" method="POST">
			Scratch username:
			<input type="text" name="username" size="12"></input>
			Password:
			<input type="password" name="password" size="12"></input>
			<input type="hidden" name="refer" value="<?php echo $_SERVER['REQUEST_URI'] ?>"></input>
			<input type="submit" value="login"></input>
			<a href="http://scratch.mit.edu/password_recovery" target="_blank">Did you forget?</a>
		</form>
	</div>
<?php } ?>